import request from '@/utils/request'

export function fetchMachineList() {
  return request({
    url: '/machines',
    method: 'get'
  })
}

export function fetchActiveMachineList() {
  return request({
    url: '/machines/active',
    method: 'get'
  })
}

export function fetchMachineById(id) {
  return request({
    url: `/machines/${id}`,
    method: 'get'
  })
}

export function createMachine(data) {
  return request({
    url: '/machines',
    method: 'post',
    data
  })
}

export function updateMachine(id, data) {
  return request({
    url: `/machines/${id}`,
    method: 'put',
    data
  })
}

export function deleteMachine(id) {
    return request({
      url: `/machines/${id}`,
      method: 'delete'
    })
}
  
